package com.example.hello_world.RecyclerView;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.example.hello_world.R;

import java.util.zip.Inflater;

public class recyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

    private Context Mycontext;
    private LayoutInflater inflater;
    public recyAdapter(Context context) {
        this.Mycontext=context;
        inflater=LayoutInflater.from(Mycontext);
    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view=inflater.inflate(R.layout.item_recyclerview,parent,false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        ViewHolder holder1= (ViewHolder) holder;
        holder1.imageView.setImageResource(R.drawable.zz);
    }

    @Override
    public int getItemCount() {
        return 6;
    }
    class ViewHolder extends RecyclerView.ViewHolder{
        private ImageView imageView;
        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            imageView=itemView.findViewById(R.id.image);
        }
    }
}
